﻿using System.ComponentModel;
using SpectrumAnalyser.ModelObjects;
using SpectrumAnalyser.ModelObjects.Enum;
using SpectrumAnalyser.Shell.PropertyGrid.Editors;

namespace SpectrumAnalyser.Shell.ViewModels
{
    public class NistSpectrumDbConnectionViewModel : SpectrumDbConnectionViewModel
    {
        public NistSpectrumDbConnectionViewModel(SpectrumDbConnection dbConnection) : base(dbConnection)
        {
        }

        [Editor(typeof (FilepathEditor), typeof (FilepathEditor))]
        public override string ConnectionString { get; set; }

        public NistSpectrumDbConnection ToCsvSpectrumDbConnection()
        {
            return new NistSpectrumDbConnection { ConnectionName = this.ConnectionName, ConnectionString = this.ConnectionString, IsUsed = IsUsed};
        }

        /*public override ConnectionType ConnectionType
        {
            get { return ConnectionType.Nist; }
        }

        public override SpectrumDbConnection ToSpectrumDbConnection()
        {
            return ToCsvSpectrumDbConnection();
        }

        public override SpectrumDbConnectionViewModel FromSpectrumDbConnection(SpectrumDbConnection connection)
        {
            return new NistSpectrumDbConnectionViewModel { ConnectionName = connection.ConnectionName, ConnectionString = connection.ConnectionString, IsUsed = connection.IsUsed };
        }*/
    }
}